You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Dew.Stats.Units Namespace > Classes > Regress Class > Regress Methods > Regress.ANOVA2 Method
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
Regress.ANOVA2 Method

Performs balanced two-way analysis of variance (ANOVA).

Syntax
C#
Visual Basic
public static TANOVA2Result ANOVA2([In] TMtx Data, out double pRows, out double pCols, out double pInt, int Replications, double Alpha);
Parameters 
Description 
[In] TMtx Data 
Stores the data to me analyzed. 
out double pRows 
Return the significance probability for the null hypothesis that rows, cols or interacted terms means are equal. These values have some meaning if Replications is more than 1. If any p is less than desired significance alpha then the result suggests the null hypothesis (rows mean, columns mean or interaction mean is not equal) can be rejected. 
out double pCols 
Return the significance probability for the null hypothesis that rows, cols or interacted terms means are equal. These values have some meaning if Replications is more than 1. If any p is less than desired significance alpha then the result suggests the null hypothesis (rows mean, columns mean or interaction mean is not equal) can be rejected. 
out double pInt 
Return the significance probability for the null hypothesis that rows, cols or interacted terms means are equal. These values have some meaning if Replications is more than 1. If any p is less than desired significance alpha then the result suggests the null hypothesis (rows mean, columns mean or interaction mean is not equal) can be rejected. 
int Replications 
Defines the number of rows/cols replications. 
double Alpha 
Desired significance level. 

Performs balanced two-way analysis of variance on ranks of data contained in Data matrix. The two-way analysis of variance compares the means of two or more rows and two or more columns. The data in different columns can be interpreted as change of one factor and data in different rows can be interpreted as changes in other factor. If there is more than one observation per row/column then you can set the number of row/column replications by changing Replications value to appropriate factor. An exception will be raised if (Data.Rows mod Replications) is not zero. Example layout for replication factor 2: 

 

Group1 Group2 Group3 Group4 Trial1 xx xx xx xx xx xx xx xx xx xx xx xx Trial2 xx xx xx xx xx xx xx xx xx xx xx xx

 

Both trials have 3 samples and data is in 4 groups.

This example shows the ANOVA on data with Replications set to 2 meaning there are two rows/cols per "cell".

using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples { private void Example() { double prows, pcols, pinteract; Matrix Data = new Matrix(0, 0); Data.SetIt(4, 4, false, new double[] {2.5, 3.2, 4.2, 3.9, 1.9, 3.5, 3.6, 3.7, 3.4, 3.5, 3.3, 3.4, 4.2, 5.0, 3.1, 2.4}); TANOVA2Result ar = Regress.ANOVA2(Data, out prows, out pcols, out pinteract, 2, 0.05); // ar =(SS1:0.2025; SS2:1.37; SS3:4.4675; SS4:2.39; SSTotal:8.43 ; // Deg1: 1; Deg2:3 ; Deg3:3; Deg4:8 ; DegTotal:15 ; // MS1:0.2025 ; MS2:0.45666666667 ; MS3:1.4891666667 ; MS4:0.29875 ; // FDist1:0.060496875 ; FDist2:0.13642916667 ; FDist3:0.44488854167 ; // FCrit1:5.3176550716 ; FCrit2:4.0661805514 ; FCrit3:4.0661805514 ; // pRows: 0.81190529881 // pCols: 0.93549639694 // pInteract: 0.72753486979 } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!